package com.tocea.formation.users.library;


public class Exemplaire implements IExemplaire
{
    
    
    private IBook book;
    private int nb;
    
    

    public Exemplaire(IBook book) {
        
        super();
        this.book = book;
        this.nb = 0;
    }
    
    public Exemplaire(IBook book, int nb) {
    
        super();
        this.book = book;
        this.nb = nb;
    }

    public IBook getBook() {
    
        return book;
    }
    
    public int getNbExemplaires() {
    
        return nb;
    }
    
    public void addExemplaire(int _nb) {
    
        nb += _nb;
    }
    
    public void removeExemplaire(int _nb) throws NotEnoughtExemplaireException {
        if (nb - _nb < 0) throw new NotEnoughtExemplaireException("");
        else {
            nb -= _nb;
        }
        
    }
    
}
